from sqlalchemy import Column, Integer, String, create_engine
from sqlalchemy.ext.declarative import declarative_base

Base = declarative_base()


class news_data(Base):
    __tablename__ = "news_data"
    id = Column(Integer, primary_key=True, autoincrement=True)
    type = Column(String(20))
    text = Column(String(2000))


class news_after_treat_data(Base):
    __tablename__ = "news_after_treat_data"
    id = Column(Integer, primary_key=True, autoincrement=True)
    type = Column(String(20))
    json = Column(String(2000))


if __name__ == '__main__':
    news_data.__table__
    engine = create_engine('sqlite:///database/news.db')
    Base.metadata.create_all(engine, checkfirst=True)